<script type="jsx">
export default {
  name: 'AbstractPagination',

  functional: true,

  props: {
    model: {
      type: Object,
      default: () => ({ total: 0, page: 1, pageSize: 10 })
    }
  },

  render(h, context) {
    const {
      model: { total, page, pageSize }
    } = context.props
    return (
      <el-pagination
        background
        current-page={page}
        page-sizes={[10, 20, 50, 100]}
        page-size={pageSize}
        total={total}
        layout="total, prev, pager, next, sizes, jumper"
        {...context.data}
      />
    )
  }
}
</script>
